#ifndef SCENE_H
#define SCENE_H

#include <vector>
#include <unordered_map>
#include <memory>
#include "entity.h"
#include "spatial_partition.h"

namespace world {

class Scene
{
public:
    Scene(int id, const std::string& name);
    ~Scene();
    
    int get_id() const;
    std::string get_name() const;
    
    void update();
    
    bool add_entity(std::shared_ptr<Entity> entity);
    void remove_entity(int entity_id);
    std::shared_ptr<Entity> get_entity(int entity_id) const;
    
    std::vector<std::shared_ptr<Entity>> get_entities_in_range(const Position& pos, float range) const;
    
private:
    int id_;
    std::string name_;
    std::unordered_map<int, std::shared_ptr<Entity>> entities_;
    std::unique_ptr<SpatialPartition> spatial_partition_;
};

} // namespace world

#endif // SCENE_H    